<template>
        <button @click="changeDone(props.todoid)">{{done?"已完成":"未完成"}}</button>
        <button @click="deleteItem(props.todoid)">删除</button>
</template>

<script setup>
//组合式API
    import {ref,reactive,defineEmits,inject} from 'vue'
    const props=defineProps({
        done:Boolean,
        todoid:Number
    });
    let changeDone=inject("changeDone");//接收父级组件注入函数 或 数据.
    let deleteItem=inject("deleteItem");
</script>

<style lang="scss" scoped>

</style>